﻿using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;

#nullable disable

namespace EfCoreDatabaseFirstDemo.Models
{
    public partial class ReferralContext : DbContext
    {
        public ReferralContext()
        {
        }

        public ReferralContext(DbContextOptions<ReferralContext> options)
            : base(options)
        {
        }

        public virtual DbSet<Abpauditlog> Abpauditlogs { get; set; }
        public virtual DbSet<Abpbackgroundjob> Abpbackgroundjobs { get; set; }
        public virtual DbSet<Abpedition> Abpeditions { get; set; }
        public virtual DbSet<Abpentitychange> Abpentitychanges { get; set; }
        public virtual DbSet<Abpentitychangeset> Abpentitychangesets { get; set; }
        public virtual DbSet<Abpentitypropertychange> Abpentitypropertychanges { get; set; }
        public virtual DbSet<Abpfeature> Abpfeatures { get; set; }
        public virtual DbSet<Abplanguage> Abplanguages { get; set; }
        public virtual DbSet<Abplanguagetext> Abplanguagetexts { get; set; }
        public virtual DbSet<Abpnotification> Abpnotifications { get; set; }
        public virtual DbSet<Abpnotificationsubscription> Abpnotificationsubscriptions { get; set; }
        public virtual DbSet<Abporganizationunit> Abporganizationunits { get; set; }
        public virtual DbSet<Abporganizationunitrole> Abporganizationunitroles { get; set; }
        public virtual DbSet<Abppermission> Abppermissions { get; set; }
        public virtual DbSet<Abppersistedgrant> Abppersistedgrants { get; set; }
        public virtual DbSet<Abprole> Abproles { get; set; }
        public virtual DbSet<Abproleclaim> Abproleclaims { get; set; }
        public virtual DbSet<Abpsetting> Abpsettings { get; set; }
        public virtual DbSet<Abptenant> Abptenants { get; set; }
        public virtual DbSet<Abptenantnotification> Abptenantnotifications { get; set; }
        public virtual DbSet<Abpuser> Abpusers { get; set; }
        public virtual DbSet<Abpuseraccount> Abpuseraccounts { get; set; }
        public virtual DbSet<Abpuserclaim> Abpuserclaims { get; set; }
        public virtual DbSet<Abpuserlogin> Abpuserlogins { get; set; }
        public virtual DbSet<Abpuserloginattempt> Abpuserloginattempts { get; set; }
        public virtual DbSet<Abpusernotification> Abpusernotifications { get; set; }
        public virtual DbSet<Abpuserorganizationunit> Abpuserorganizationunits { get; set; }
        public virtual DbSet<Abpuserrole> Abpuserroles { get; set; }
        public virtual DbSet<Abpusertoken> Abpusertokens { get; set; }
        public virtual DbSet<Appvision> Appvisions { get; set; }
        public virtual DbSet<Computeroptometry> Computeroptometrys { get; set; }
        public virtual DbSet<Efmigrationshistory> Efmigrationshistories { get; set; }
        public virtual DbSet<Examrecord> Examrecords { get; set; }
        public virtual DbSet<Extrendmenu> Extrendmenus { get; set; }
        public virtual DbSet<Iolmaster> Iolmasters { get; set; }
        public virtual DbSet<Patient> Patients { get; set; }
        public virtual DbSet<Patientextend> Patientextends { get; set; }
        public virtual DbSet<Referral> Referrals { get; set; }
        public virtual DbSet<Reporttemplate> Reporttemplates { get; set; }
        public virtual DbSet<Reporttenanttemplate> Reporttenanttemplates { get; set; }
        public virtual DbSet<Screening> Screenings { get; set; }
        public virtual DbSet<Screeningunit> Screeningunits { get; set; }
        public virtual DbSet<Screeninstrument> Screeninstruments { get; set; }
        public virtual DbSet<Visualchart> Visualcharts { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
                optionsBuilder.UseMySql("server=47.101.150.96;uid=sa;pwd=Suoer2013;database=Referral", x => x.ServerVersion("8.0.16-mysql"));
            }
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Abpauditlog>(entity =>
            {
                entity.ToTable("abpauditlogs");

                entity.HasIndex(e => new { e.TenantId, e.ExecutionDuration }, "IX_AbpAuditLogs_TenantId_ExecutionDuration");

                entity.HasIndex(e => new { e.TenantId, e.ExecutionTime }, "IX_AbpAuditLogs_TenantId_ExecutionTime");

                entity.HasIndex(e => new { e.TenantId, e.UserId }, "IX_AbpAuditLogs_TenantId_UserId");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.BrowserInfo)
                    .HasColumnType("varchar(512)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ClientIpAddress)
                    .HasColumnType("varchar(64)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ClientName)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CustomData)
                    .HasColumnType("varchar(2000)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Exception)
                    .HasColumnType("varchar(2000)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ExecutionDuration).HasColumnType("int(11)");

                entity.Property(e => e.ExecutionTime).HasMaxLength(6);

                entity.Property(e => e.ImpersonatorTenantId).HasColumnType("int(11)");

                entity.Property(e => e.ImpersonatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.MethodName)
                    .HasColumnType("varchar(256)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Parameters)
                    .HasColumnType("varchar(1024)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ReturnValue)
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ServiceName)
                    .HasColumnType("varchar(256)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.UserId).HasColumnType("bigint(20)");
            });

            modelBuilder.Entity<Abpbackgroundjob>(entity =>
            {
                entity.ToTable("abpbackgroundjobs");

                entity.HasIndex(e => new { e.IsAbandoned, e.NextTryTime }, "IX_AbpBackgroundJobs_IsAbandoned_NextTryTime");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.IsAbandoned).HasColumnType("bit(1)");

                entity.Property(e => e.JobArgs)
                    .IsRequired()
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.JobType)
                    .IsRequired()
                    .HasColumnType("varchar(512)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.LastTryTime).HasMaxLength(6);

                entity.Property(e => e.NextTryTime).HasMaxLength(6);

                entity.Property(e => e.Priority).HasColumnType("tinyint(3) unsigned");

                entity.Property(e => e.TryCount).HasColumnType("smallint(6)");
            });

            modelBuilder.Entity<Abpedition>(entity =>
            {
                entity.ToTable("abpeditions");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.DisplayName)
                    .IsRequired()
                    .HasColumnType("varchar(64)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");
            });

            modelBuilder.Entity<Abpentitychange>(entity =>
            {
                entity.ToTable("abpentitychanges");

                entity.HasIndex(e => e.EntityChangeSetId, "IX_AbpEntityChanges_EntityChangeSetId");

                entity.HasIndex(e => new { e.EntityTypeFullName, e.EntityId }, "IX_AbpEntityChanges_EntityTypeFullName_EntityId");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.ChangeTime).HasMaxLength(6);

                entity.Property(e => e.ChangeType).HasColumnType("tinyint(3) unsigned");

                entity.Property(e => e.EntityChangeSetId).HasColumnType("bigint(20)");

                entity.Property(e => e.EntityId)
                    .HasColumnType("varchar(48)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.EntityTypeFullName)
                    .HasColumnType("varchar(192)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.HasOne(d => d.EntityChangeSet)
                    .WithMany(p => p.Abpentitychanges)
                    .HasForeignKey(d => d.EntityChangeSetId)
                    .HasConstraintName("FK_AbpEntityChanges_AbpEntityChangeSets_EntityChangeSetId");
            });

            modelBuilder.Entity<Abpentitychangeset>(entity =>
            {
                entity.ToTable("abpentitychangesets");

                entity.HasIndex(e => new { e.TenantId, e.CreationTime }, "IX_AbpEntityChangeSets_TenantId_CreationTime");

                entity.HasIndex(e => new { e.TenantId, e.Reason }, "IX_AbpEntityChangeSets_TenantId_Reason");

                entity.HasIndex(e => new { e.TenantId, e.UserId }, "IX_AbpEntityChangeSets_TenantId_UserId");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.BrowserInfo)
                    .HasColumnType("varchar(512)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ClientIpAddress)
                    .HasColumnType("varchar(64)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ClientName)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.ExtensionData)
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ImpersonatorTenantId).HasColumnType("int(11)");

                entity.Property(e => e.ImpersonatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Reason)
                    .HasColumnType("varchar(256)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.UserId).HasColumnType("bigint(20)");
            });

            modelBuilder.Entity<Abpentitypropertychange>(entity =>
            {
                entity.ToTable("abpentitypropertychanges");

                entity.HasIndex(e => e.EntityChangeId, "IX_AbpEntityPropertyChanges_EntityChangeId");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.EntityChangeId).HasColumnType("bigint(20)");

                entity.Property(e => e.NewValue)
                    .HasColumnType("varchar(512)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.OriginalValue)
                    .HasColumnType("varchar(512)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.PropertyName)
                    .HasColumnType("varchar(96)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.PropertyTypeFullName)
                    .HasColumnType("varchar(192)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.HasOne(d => d.EntityChange)
                    .WithMany(p => p.Abpentitypropertychanges)
                    .HasForeignKey(d => d.EntityChangeId)
                    .HasConstraintName("FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId");
            });

            modelBuilder.Entity<Abpfeature>(entity =>
            {
                entity.ToTable("abpfeatures");

                entity.HasIndex(e => new { e.EditionId, e.Name }, "IX_AbpFeatures_EditionId_Name");

                entity.HasIndex(e => new { e.TenantId, e.Name }, "IX_AbpFeatures_TenantId_Name");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Discriminator)
                    .IsRequired()
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.EditionId).HasColumnType("int(11)");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.Value)
                    .IsRequired()
                    .HasColumnType("varchar(2000)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.HasOne(d => d.Edition)
                    .WithMany(p => p.Abpfeatures)
                    .HasForeignKey(d => d.EditionId)
                    .OnDelete(DeleteBehavior.Cascade)
                    .HasConstraintName("FK_AbpFeatures_AbpEditions_EditionId");
            });

            modelBuilder.Entity<Abplanguage>(entity =>
            {
                entity.ToTable("abplanguages");

                entity.HasIndex(e => new { e.TenantId, e.Name }, "IX_AbpLanguages_TenantId_Name");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.DisplayName)
                    .IsRequired()
                    .HasColumnType("varchar(64)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Icon)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.IsDisabled).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Abplanguagetext>(entity =>
            {
                entity.ToTable("abplanguagetexts");

                entity.HasIndex(e => new { e.TenantId, e.Source, e.LanguageName, e.Key }, "IX_AbpLanguageTexts_TenantId_Source_LanguageName_Key");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Key)
                    .IsRequired()
                    .HasColumnType("varchar(256)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.LanguageName)
                    .IsRequired()
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Source)
                    .IsRequired()
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.Value)
                    .IsRequired()
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");
            });

            modelBuilder.Entity<Abpnotification>(entity =>
            {
                entity.ToTable("abpnotifications");

                entity.Property(e => e.Id)
                    .ValueGeneratedNever()
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Data)
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.DataTypeName)
                    .HasColumnType("varchar(512)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.EntityId)
                    .HasColumnType("varchar(96)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.EntityTypeAssemblyQualifiedName)
                    .HasColumnType("varchar(512)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.EntityTypeName)
                    .HasColumnType("varchar(250)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ExcludedUserIds)
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.NotificationName)
                    .IsRequired()
                    .HasColumnType("varchar(96)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Severity).HasColumnType("tinyint(3) unsigned");

                entity.Property(e => e.TenantIds)
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.UserIds)
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");
            });

            modelBuilder.Entity<Abpnotificationsubscription>(entity =>
            {
                entity.ToTable("abpnotificationsubscriptions");

                entity.HasIndex(e => new { e.NotificationName, e.EntityTypeName, e.EntityId, e.UserId }, "IX_AbpNotificationSubscriptions_NotificationName_EntityTypeName~");

                entity.HasIndex(e => new { e.TenantId, e.NotificationName, e.EntityTypeName, e.EntityId, e.UserId }, "IX_AbpNotificationSubscriptions_TenantId_NotificationName_Entit~");

                entity.Property(e => e.Id)
                    .ValueGeneratedNever()
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.EntityId)
                    .HasColumnType("varchar(96)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.EntityTypeAssemblyQualifiedName)
                    .HasColumnType("varchar(512)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.EntityTypeName)
                    .HasColumnType("varchar(250)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.NotificationName)
                    .HasColumnType("varchar(96)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.UserId).HasColumnType("bigint(20)");
            });

            modelBuilder.Entity<Abporganizationunit>(entity =>
            {
                entity.ToTable("abporganizationunits");

                entity.HasIndex(e => e.ParentId, "IX_AbpOrganizationUnits_ParentId");

                entity.HasIndex(e => new { e.TenantId, e.Code }, "IX_AbpOrganizationUnits_TenantId_Code");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.Code)
                    .IsRequired()
                    .HasColumnType("varchar(95)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.DisplayName)
                    .IsRequired()
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.ParentId).HasColumnType("bigint(20)");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.HasOne(d => d.Parent)
                    .WithMany(p => p.InverseParent)
                    .HasForeignKey(d => d.ParentId)
                    .HasConstraintName("FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId");
            });

            modelBuilder.Entity<Abporganizationunitrole>(entity =>
            {
                entity.ToTable("abporganizationunitroles");

                entity.HasIndex(e => new { e.TenantId, e.OrganizationUnitId }, "IX_AbpOrganizationUnitRoles_TenantId_OrganizationUnitId");

                entity.HasIndex(e => new { e.TenantId, e.RoleId }, "IX_AbpOrganizationUnitRoles_TenantId_RoleId");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.OrganizationUnitId).HasColumnType("bigint(20)");

                entity.Property(e => e.RoleId).HasColumnType("int(11)");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Abppermission>(entity =>
            {
                entity.ToTable("abppermissions");

                entity.HasIndex(e => e.RoleId, "IX_AbpPermissions_RoleId");

                entity.HasIndex(e => new { e.TenantId, e.Name }, "IX_AbpPermissions_TenantId_Name");

                entity.HasIndex(e => e.UserId, "IX_AbpPermissions_UserId");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Discriminator)
                    .IsRequired()
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.IsGranted).HasColumnType("bit(1)");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.RoleId).HasColumnType("int(11)");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.UserId).HasColumnType("bigint(20)");

                entity.HasOne(d => d.Role)
                    .WithMany(p => p.Abppermissions)
                    .HasForeignKey(d => d.RoleId)
                    .OnDelete(DeleteBehavior.Cascade)
                    .HasConstraintName("FK_AbpPermissions_AbpRoles_RoleId");

                entity.HasOne(d => d.User)
                    .WithMany(p => p.Abppermissions)
                    .HasForeignKey(d => d.UserId)
                    .OnDelete(DeleteBehavior.Cascade)
                    .HasConstraintName("FK_AbpPermissions_AbpUsers_UserId");
            });

            modelBuilder.Entity<Abppersistedgrant>(entity =>
            {
                entity.ToTable("abppersistedgrants");

                entity.HasIndex(e => new { e.SubjectId, e.ClientId, e.Type }, "IX_AbpPersistedGrants_SubjectId_ClientId_Type");

                entity.Property(e => e.Id)
                    .HasColumnType("varchar(200)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ClientId)
                    .IsRequired()
                    .HasColumnType("varchar(200)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.Data)
                    .IsRequired()
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Expiration).HasMaxLength(6);

                entity.Property(e => e.SubjectId)
                    .HasColumnType("varchar(200)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Type)
                    .IsRequired()
                    .HasColumnType("varchar(50)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");
            });

            modelBuilder.Entity<Abprole>(entity =>
            {
                entity.ToTable("abproles");

                entity.HasIndex(e => e.CreatorUserId, "IX_AbpRoles_CreatorUserId");

                entity.HasIndex(e => e.DeleterUserId, "IX_AbpRoles_DeleterUserId");

                entity.HasIndex(e => e.LastModifierUserId, "IX_AbpRoles_LastModifierUserId");

                entity.HasIndex(e => new { e.TenantId, e.NormalizedName }, "IX_AbpRoles_TenantId_NormalizedName");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.ConcurrencyStamp)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.Description)
                    .HasColumnType("varchar(200)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.DisplayName)
                    .IsRequired()
                    .HasColumnType("varchar(64)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.IsDefault).HasColumnType("bit(1)");

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.IsStatic).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.NormalizedName)
                    .IsRequired()
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.HasOne(d => d.CreatorUser)
                    .WithMany(p => p.AbproleCreatorUsers)
                    .HasForeignKey(d => d.CreatorUserId)
                    .HasConstraintName("FK_AbpRoles_AbpUsers_CreatorUserId");

                entity.HasOne(d => d.DeleterUser)
                    .WithMany(p => p.AbproleDeleterUsers)
                    .HasForeignKey(d => d.DeleterUserId)
                    .HasConstraintName("FK_AbpRoles_AbpUsers_DeleterUserId");

                entity.HasOne(d => d.LastModifierUser)
                    .WithMany(p => p.AbproleLastModifierUsers)
                    .HasForeignKey(d => d.LastModifierUserId)
                    .HasConstraintName("FK_AbpRoles_AbpUsers_LastModifierUserId");
            });

            modelBuilder.Entity<Abproleclaim>(entity =>
            {
                entity.ToTable("abproleclaims");

                entity.HasIndex(e => e.RoleId, "IX_AbpRoleClaims_RoleId");

                entity.HasIndex(e => new { e.TenantId, e.ClaimType }, "IX_AbpRoleClaims_TenantId_ClaimType");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.ClaimType)
                    .HasColumnType("varchar(256)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ClaimValue)
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.RoleId).HasColumnType("int(11)");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.HasOne(d => d.Role)
                    .WithMany(p => p.Abproleclaims)
                    .HasForeignKey(d => d.RoleId)
                    .HasConstraintName("FK_AbpRoleClaims_AbpRoles_RoleId");
            });

            modelBuilder.Entity<Abpsetting>(entity =>
            {
                entity.ToTable("abpsettings");

                entity.HasIndex(e => new { e.TenantId, e.Name, e.UserId }, "IX_AbpSettings_TenantId_Name_UserId")
                    .IsUnique();

                entity.HasIndex(e => e.UserId, "IX_AbpSettings_UserId");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasColumnType("varchar(256)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.UserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Value)
                    .HasColumnType("varchar(2000)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.HasOne(d => d.User)
                    .WithMany(p => p.Abpsettings)
                    .HasForeignKey(d => d.UserId)
                    .HasConstraintName("FK_AbpSettings_AbpUsers_UserId");
            });

            modelBuilder.Entity<Abptenant>(entity =>
            {
                entity.ToTable("abptenants");

                entity.HasIndex(e => e.CreatorUserId, "IX_AbpTenants_CreatorUserId");

                entity.HasIndex(e => e.DeleterUserId, "IX_AbpTenants_DeleterUserId");

                entity.HasIndex(e => e.EditionId, "IX_AbpTenants_EditionId");

                entity.HasIndex(e => e.LastModifierUserId, "IX_AbpTenants_LastModifierUserId");

                entity.HasIndex(e => e.TenancyName, "IX_AbpTenants_TenancyName");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.Address)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.AdminPhoneNumber)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.City)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CityName)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ConnectionString)
                    .HasColumnType("varchar(1024)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.County)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CountyName)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.Description)
                    .HasColumnType("varchar(64)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.DueDate)
                    .HasMaxLength(6)
                    .HasDefaultValueSql("'0001-01-01 00:00:00.000000'");

                entity.Property(e => e.EditionId).HasColumnType("int(11)");

                entity.Property(e => e.IsActive).HasColumnType("bit(1)");

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Province)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ProvinceName)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenancyName)
                    .IsRequired()
                    .HasColumnType("varchar(64)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.HasOne(d => d.CreatorUser)
                    .WithMany(p => p.AbptenantCreatorUsers)
                    .HasForeignKey(d => d.CreatorUserId)
                    .HasConstraintName("FK_AbpTenants_AbpUsers_CreatorUserId");

                entity.HasOne(d => d.DeleterUser)
                    .WithMany(p => p.AbptenantDeleterUsers)
                    .HasForeignKey(d => d.DeleterUserId)
                    .HasConstraintName("FK_AbpTenants_AbpUsers_DeleterUserId");

                entity.HasOne(d => d.Edition)
                    .WithMany(p => p.Abptenants)
                    .HasForeignKey(d => d.EditionId)
                    .HasConstraintName("FK_AbpTenants_AbpEditions_EditionId");

                entity.HasOne(d => d.LastModifierUser)
                    .WithMany(p => p.AbptenantLastModifierUsers)
                    .HasForeignKey(d => d.LastModifierUserId)
                    .HasConstraintName("FK_AbpTenants_AbpUsers_LastModifierUserId");
            });

            modelBuilder.Entity<Abptenantnotification>(entity =>
            {
                entity.ToTable("abptenantnotifications");

                entity.HasIndex(e => e.TenantId, "IX_AbpTenantNotifications_TenantId");

                entity.Property(e => e.Id)
                    .ValueGeneratedNever()
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Data)
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.DataTypeName)
                    .HasColumnType("varchar(512)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.EntityId)
                    .HasColumnType("varchar(96)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.EntityTypeAssemblyQualifiedName)
                    .HasColumnType("varchar(512)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.EntityTypeName)
                    .HasColumnType("varchar(250)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.NotificationName)
                    .IsRequired()
                    .HasColumnType("varchar(96)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Severity).HasColumnType("tinyint(3) unsigned");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Abpuser>(entity =>
            {
                entity.ToTable("abpusers");

                entity.HasIndex(e => e.CreatorUserId, "IX_AbpUsers_CreatorUserId");

                entity.HasIndex(e => e.DeleterUserId, "IX_AbpUsers_DeleterUserId");

                entity.HasIndex(e => e.LastModifierUserId, "IX_AbpUsers_LastModifierUserId");

                entity.HasIndex(e => new { e.TenantId, e.NormalizedEmailAddress }, "IX_AbpUsers_TenantId_NormalizedEmailAddress");

                entity.HasIndex(e => new { e.TenantId, e.NormalizedUserName }, "IX_AbpUsers_TenantId_NormalizedUserName");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.AccessFailedCount).HasColumnType("int(11)");

                entity.Property(e => e.AuthenticationSource)
                    .HasColumnType("varchar(64)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ConcurrencyStamp)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.EmailAddress)
                    .IsRequired()
                    .HasColumnType("varchar(256)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.EmailConfirmationCode)
                    .HasColumnType("varchar(328)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.IsActive).HasColumnType("bit(1)");

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.IsEmailConfirmed).HasColumnType("bit(1)");

                entity.Property(e => e.IsLockoutEnabled).HasColumnType("bit(1)");

                entity.Property(e => e.IsPhoneNumberConfirmed).HasColumnType("bit(1)");

                entity.Property(e => e.IsTwoFactorEnabled).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.LockoutEndDateUtc).HasMaxLength(6);

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasColumnType("varchar(64)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.NormalizedEmailAddress)
                    .IsRequired()
                    .HasColumnType("varchar(256)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.NormalizedUserName)
                    .IsRequired()
                    .HasColumnType("varchar(256)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Password)
                    .IsRequired()
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.PasswordResetCode)
                    .HasColumnType("varchar(328)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.PhoneNumber)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.SecurityStamp)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Surname)
                    .IsRequired()
                    .HasColumnType("varchar(64)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.UserName)
                    .IsRequired()
                    .HasColumnType("varchar(256)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.HasOne(d => d.CreatorUser)
                    .WithMany(p => p.InverseCreatorUser)
                    .HasForeignKey(d => d.CreatorUserId)
                    .HasConstraintName("FK_AbpUsers_AbpUsers_CreatorUserId");

                entity.HasOne(d => d.DeleterUser)
                    .WithMany(p => p.InverseDeleterUser)
                    .HasForeignKey(d => d.DeleterUserId)
                    .HasConstraintName("FK_AbpUsers_AbpUsers_DeleterUserId");

                entity.HasOne(d => d.LastModifierUser)
                    .WithMany(p => p.InverseLastModifierUser)
                    .HasForeignKey(d => d.LastModifierUserId)
                    .HasConstraintName("FK_AbpUsers_AbpUsers_LastModifierUserId");
            });

            modelBuilder.Entity<Abpuseraccount>(entity =>
            {
                entity.ToTable("abpuseraccounts");

                entity.HasIndex(e => e.EmailAddress, "IX_AbpUserAccounts_EmailAddress");

                entity.HasIndex(e => new { e.TenantId, e.EmailAddress }, "IX_AbpUserAccounts_TenantId_EmailAddress");

                entity.HasIndex(e => new { e.TenantId, e.UserId }, "IX_AbpUserAccounts_TenantId_UserId");

                entity.HasIndex(e => new { e.TenantId, e.UserName }, "IX_AbpUserAccounts_TenantId_UserName");

                entity.HasIndex(e => e.UserName, "IX_AbpUserAccounts_UserName");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.EmailAddress)
                    .HasColumnType("varchar(256)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.UserId).HasColumnType("bigint(20)");

                entity.Property(e => e.UserLinkId).HasColumnType("bigint(20)");

                entity.Property(e => e.UserName)
                    .HasColumnType("varchar(256)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");
            });

            modelBuilder.Entity<Abpuserclaim>(entity =>
            {
                entity.ToTable("abpuserclaims");

                entity.HasIndex(e => new { e.TenantId, e.ClaimType }, "IX_AbpUserClaims_TenantId_ClaimType");

                entity.HasIndex(e => e.UserId, "IX_AbpUserClaims_UserId");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.ClaimType)
                    .HasColumnType("varchar(256)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ClaimValue)
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.UserId).HasColumnType("bigint(20)");

                entity.HasOne(d => d.User)
                    .WithMany(p => p.Abpuserclaims)
                    .HasForeignKey(d => d.UserId)
                    .HasConstraintName("FK_AbpUserClaims_AbpUsers_UserId");
            });

            modelBuilder.Entity<Abpuserlogin>(entity =>
            {
                entity.ToTable("abpuserlogins");

                entity.HasIndex(e => new { e.TenantId, e.LoginProvider, e.ProviderKey }, "IX_AbpUserLogins_TenantId_LoginProvider_ProviderKey");

                entity.HasIndex(e => new { e.TenantId, e.UserId }, "IX_AbpUserLogins_TenantId_UserId");

                entity.HasIndex(e => e.UserId, "IX_AbpUserLogins_UserId");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.LoginProvider)
                    .IsRequired()
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ProviderKey)
                    .IsRequired()
                    .HasColumnType("varchar(256)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.UserId).HasColumnType("bigint(20)");

                entity.HasOne(d => d.User)
                    .WithMany(p => p.Abpuserlogins)
                    .HasForeignKey(d => d.UserId)
                    .HasConstraintName("FK_AbpUserLogins_AbpUsers_UserId");
            });

            modelBuilder.Entity<Abpuserloginattempt>(entity =>
            {
                entity.ToTable("abpuserloginattempts");

                entity.HasIndex(e => new { e.TenancyName, e.UserNameOrEmailAddress, e.Result }, "IX_AbpUserLoginAttempts_TenancyName_UserNameOrEmailAddress_Resu~");

                entity.HasIndex(e => new { e.UserId, e.TenantId }, "IX_AbpUserLoginAttempts_UserId_TenantId");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.BrowserInfo)
                    .HasColumnType("varchar(512)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ClientIpAddress)
                    .HasColumnType("varchar(64)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ClientName)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.Result).HasColumnType("tinyint(3) unsigned");

                entity.Property(e => e.TenancyName)
                    .HasColumnType("varchar(64)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.UserId).HasColumnType("bigint(20)");

                entity.Property(e => e.UserNameOrEmailAddress)
                    .HasColumnType("varchar(255)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");
            });

            modelBuilder.Entity<Abpusernotification>(entity =>
            {
                entity.ToTable("abpusernotifications");

                entity.HasIndex(e => new { e.UserId, e.State, e.CreationTime }, "IX_AbpUserNotifications_UserId_State_CreationTime");

                entity.Property(e => e.Id)
                    .ValueGeneratedNever()
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.State).HasColumnType("int(11)");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.TenantNotificationId)
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.UserId).HasColumnType("bigint(20)");
            });

            modelBuilder.Entity<Abpuserorganizationunit>(entity =>
            {
                entity.ToTable("abpuserorganizationunits");

                entity.HasIndex(e => new { e.TenantId, e.OrganizationUnitId }, "IX_AbpUserOrganizationUnits_TenantId_OrganizationUnitId");

                entity.HasIndex(e => new { e.TenantId, e.UserId }, "IX_AbpUserOrganizationUnits_TenantId_UserId");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.OrganizationUnitId).HasColumnType("bigint(20)");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.UserId).HasColumnType("bigint(20)");
            });

            modelBuilder.Entity<Abpuserrole>(entity =>
            {
                entity.ToTable("abpuserroles");

                entity.HasIndex(e => new { e.TenantId, e.RoleId }, "IX_AbpUserRoles_TenantId_RoleId");

                entity.HasIndex(e => new { e.TenantId, e.UserId }, "IX_AbpUserRoles_TenantId_UserId");

                entity.HasIndex(e => e.UserId, "IX_AbpUserRoles_UserId");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.RoleId).HasColumnType("int(11)");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.UserId).HasColumnType("bigint(20)");

                entity.HasOne(d => d.User)
                    .WithMany(p => p.Abpuserroles)
                    .HasForeignKey(d => d.UserId)
                    .HasConstraintName("FK_AbpUserRoles_AbpUsers_UserId");
            });

            modelBuilder.Entity<Abpusertoken>(entity =>
            {
                entity.ToTable("abpusertokens");

                entity.HasIndex(e => new { e.TenantId, e.UserId }, "IX_AbpUserTokens_TenantId_UserId");

                entity.HasIndex(e => e.UserId, "IX_AbpUserTokens_UserId");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.ExpireDate).HasMaxLength(6);

                entity.Property(e => e.LoginProvider)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Name)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.UserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Value)
                    .HasColumnType("varchar(512)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.HasOne(d => d.User)
                    .WithMany(p => p.Abpusertokens)
                    .HasForeignKey(d => d.UserId)
                    .HasConstraintName("FK_AbpUserTokens_AbpUsers_UserId");
            });

            modelBuilder.Entity<Appvision>(entity =>
            {
                entity.ToTable("appvisions");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.ApkMd5)
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.AppPlatform).HasColumnType("int(11)");

                entity.Property(e => e.AppType).HasColumnType("int(11)");

                entity.Property(e => e.Build).HasColumnType("int(11)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.Description)
                    .IsRequired()
                    .HasColumnType("varchar(256)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.DisplayVision)
                    .IsRequired()
                    .HasColumnType("varchar(20)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.DownLoadUrl)
                    .IsRequired()
                    .HasColumnType("varchar(1024)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Vision).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Computeroptometry>(entity =>
            {
                entity.ToTable("computeroptometrys");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.ClinicDate).HasMaxLength(6);

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.DeviceId)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.DeviceName)
                    .HasColumnType("varchar(12)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ExamRecordId).HasColumnType("bigint(20)");

                entity.Property(e => e.ExamRecordType).HasColumnType("int(11)");

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.Laflat)
                    .HasColumnType("int(11)")
                    .HasColumnName("LAFlat");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Lasteep)
                    .HasColumnType("int(11)")
                    .HasColumnName("LASteep");

                entity.Property(e => e.Laxs)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("LAXS");

                entity.Property(e => e.Lcyl)
                    .HasPrecision(5, 2)
                    .HasColumnName("LCYL");

                entity.Property(e => e.Levaluation)
                    .HasColumnType("int(11)")
                    .HasColumnName("LEvaluation");

                entity.Property(e => e.Lkflat)
                    .HasPrecision(5, 2)
                    .HasColumnName("LKFlat");

                entity.Property(e => e.Lksteep)
                    .HasPrecision(5, 2)
                    .HasColumnName("LKSteep");

                entity.Property(e => e.Lsph)
                    .HasPrecision(5, 2)
                    .HasColumnName("LSPH");

                entity.Property(e => e.OrganizationCode)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.PatientBirthdate).HasMaxLength(6);

                entity.Property(e => e.PatientGender).HasColumnType("int(11)");

                entity.Property(e => e.PatientId).HasColumnType("bigint(20)");

                entity.Property(e => e.PatientMonth).HasColumnType("int(11)");

                entity.Property(e => e.Pd)
                    .HasPrecision(3, 1)
                    .HasColumnName("PD");

                entity.Property(e => e.ProductKey)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Raflat)
                    .HasColumnType("int(11)")
                    .HasColumnName("RAFlat");

                entity.Property(e => e.Rasteep)
                    .HasColumnType("int(11)")
                    .HasColumnName("RASteep");

                entity.Property(e => e.Raxs)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("RAXS");

                entity.Property(e => e.Rcyl)
                    .HasPrecision(5, 2)
                    .HasColumnName("RCYL");

                entity.Property(e => e.Remark)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Revaluation)
                    .HasColumnType("int(11)")
                    .HasColumnName("REvaluation");

                entity.Property(e => e.Rkflat)
                    .HasPrecision(5, 2)
                    .HasColumnName("RKFlat");

                entity.Property(e => e.Rksteep)
                    .HasPrecision(5, 2)
                    .HasColumnName("RKSteep");

                entity.Property(e => e.Rsph)
                    .HasPrecision(5, 2)
                    .HasColumnName("RSPH");

                entity.Property(e => e.ScreeningId).HasColumnType("bigint(20)");

                entity.Property(e => e.ScreeningUnitCode)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Efmigrationshistory>(entity =>
            {
                entity.HasKey(e => e.MigrationId)
                    .HasName("PRIMARY");

                entity.ToTable("__efmigrationshistory");

                entity.Property(e => e.MigrationId)
                    .HasColumnType("varchar(95)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ProductVersion)
                    .IsRequired()
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");
            });

            modelBuilder.Entity<Examrecord>(entity =>
            {
                entity.ToTable("examrecords");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.ExamRecordType).HasColumnType("int(11)");

                entity.Property(e => e.ExamStatus).HasColumnType("int(11)");

                entity.Property(e => e.ExamTime).HasMaxLength(6);

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.OrganizationCode)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.PatientGender).HasColumnType("int(11)");

                entity.Property(e => e.PatientId).HasColumnType("bigint(20)");

                entity.Property(e => e.PatientMonth).HasColumnType("int(11)");

                entity.Property(e => e.ReferralStatus).HasColumnType("int(11)");

                entity.Property(e => e.ScreeningId).HasColumnType("bigint(20)");

                entity.Property(e => e.ScreeningUnitCode)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.StatusComputerOptometry).HasColumnType("tinyint(3) unsigned");

                entity.Property(e => e.StatusIolmaster)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("StatusIOLMaster");

                entity.Property(e => e.StatusScreenInstrument).HasColumnType("tinyint(3) unsigned");

                entity.Property(e => e.StatusVisualChart).HasColumnType("tinyint(3) unsigned");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Extrendmenu>(entity =>
            {
                entity.ToTable("extrendmenus");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.ParentPermission)
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Permission)
                    .IsRequired()
                    .HasColumnType("varchar(300)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.PermissionName)
                    .IsRequired()
                    .HasColumnType("varchar(300)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Iolmaster>(entity =>
            {
                entity.ToTable("iolmasters");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.Alaverage)
                    .HasPrecision(4, 2)
                    .HasColumnName("ALAverage");

                entity.Property(e => e.Alk)
                    .HasPrecision(5, 3)
                    .HasColumnName("ALK");

                entity.Property(e => e.Almax)
                    .HasPrecision(4, 2)
                    .HasColumnName("ALMax");

                entity.Property(e => e.ClinicDate).HasMaxLength(6);

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.DeviceId)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.DeviceName)
                    .HasColumnType("varchar(12)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ExamRecordId).HasColumnType("bigint(20)");

                entity.Property(e => e.ExamRecordType).HasColumnType("int(11)");

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.La1)
                    .HasColumnType("int(11)")
                    .HasColumnName("LA1");

                entity.Property(e => e.La2)
                    .HasColumnType("int(11)")
                    .HasColumnName("LA2");

                entity.Property(e => e.Lad)
                    .HasPrecision(3, 2)
                    .HasColumnName("LAD");

                entity.Property(e => e.Lal)
                    .HasPrecision(4, 2)
                    .HasColumnName("LAL");

                entity.Property(e => e.Lalcr)
                    .HasPrecision(6, 3)
                    .HasColumnName("LALCR");

                entity.Property(e => e.Lalevaluation)
                    .HasColumnType("int(11)")
                    .HasColumnName("LALEvaluation");

                entity.Property(e => e.Lalk)
                    .HasPrecision(5, 3)
                    .HasColumnName("LALK");

                entity.Property(e => e.Last)
                    .HasPrecision(4, 2)
                    .HasColumnName("LAST");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Lcct)
                    .HasColumnType("int(11)")
                    .HasColumnName("LCCT");

                entity.Property(e => e.LimagePath)
                    .HasColumnType("varchar(256)")
                    .HasColumnName("LImagePath")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Lk1)
                    .HasPrecision(4, 2)
                    .HasColumnName("LK1");

                entity.Property(e => e.Lk2)
                    .HasPrecision(4, 2)
                    .HasColumnName("LK2");

                entity.Property(e => e.Llt)
                    .HasPrecision(3, 2)
                    .HasColumnName("LLT");

                entity.Property(e => e.Lpupil)
                    .HasPrecision(4, 2)
                    .HasColumnName("LPupil");

                entity.Property(e => e.Lr1)
                    .HasPrecision(5, 2)
                    .HasColumnName("LR1");

                entity.Property(e => e.Lr2)
                    .HasPrecision(5, 2)
                    .HasColumnName("LR2");

                entity.Property(e => e.Lvt)
                    .HasPrecision(4, 2)
                    .HasColumnName("LVT");

                entity.Property(e => e.Lwtw)
                    .HasPrecision(4, 2)
                    .HasColumnName("LWTW");

                entity.Property(e => e.OrganizationCode)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.PatientBirthdate).HasMaxLength(6);

                entity.Property(e => e.PatientGender).HasColumnType("int(11)");

                entity.Property(e => e.PatientId).HasColumnType("bigint(20)");

                entity.Property(e => e.PatientMonth).HasColumnType("int(11)");

                entity.Property(e => e.ProductKey)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Ra1)
                    .HasColumnType("int(11)")
                    .HasColumnName("RA1");

                entity.Property(e => e.Ra2)
                    .HasColumnType("int(11)")
                    .HasColumnName("RA2");

                entity.Property(e => e.Rad)
                    .HasPrecision(3, 2)
                    .HasColumnName("RAD");

                entity.Property(e => e.Ral)
                    .HasPrecision(4, 2)
                    .HasColumnName("RAL");

                entity.Property(e => e.Ralcr)
                    .HasPrecision(6, 3)
                    .HasColumnName("RALCR");

                entity.Property(e => e.Ralevaluation)
                    .HasColumnType("int(11)")
                    .HasColumnName("RALEvaluation");

                entity.Property(e => e.Ralk)
                    .HasPrecision(5, 3)
                    .HasColumnName("RALK");

                entity.Property(e => e.Rast)
                    .HasPrecision(4, 2)
                    .HasColumnName("RAST");

                entity.Property(e => e.Rcct)
                    .HasColumnType("int(11)")
                    .HasColumnName("RCCT");

                entity.Property(e => e.Remark)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.RimagePath)
                    .HasColumnType("varchar(256)")
                    .HasColumnName("RImagePath")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Rk1)
                    .HasPrecision(4, 2)
                    .HasColumnName("RK1");

                entity.Property(e => e.Rk2)
                    .HasPrecision(4, 2)
                    .HasColumnName("RK2");

                entity.Property(e => e.Rlt)
                    .HasPrecision(3, 2)
                    .HasColumnName("RLT");

                entity.Property(e => e.Rpupil)
                    .HasPrecision(4, 2)
                    .HasColumnName("RPupil");

                entity.Property(e => e.Rr1)
                    .HasPrecision(5, 2)
                    .HasColumnName("RR1");

                entity.Property(e => e.Rr2)
                    .HasPrecision(5, 2)
                    .HasColumnName("RR2");

                entity.Property(e => e.Rvt)
                    .HasPrecision(4, 2)
                    .HasColumnName("RVT");

                entity.Property(e => e.Rwtw)
                    .HasPrecision(4, 2)
                    .HasColumnName("RWTW");

                entity.Property(e => e.ScreeningId).HasColumnType("bigint(20)");

                entity.Property(e => e.ScreeningUnitCode)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Patient>(entity =>
            {
                entity.ToTable("patient");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.Birthdate).HasMaxLength(6);

                entity.Property(e => e.CardId)
                    .HasColumnType("varchar(18)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.Gender).HasColumnType("int(11)");

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasColumnType("varchar(12)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.NameFullPinyin)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.NamePinyin)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Nation).HasColumnType("int(11)");

                entity.Property(e => e.Phone)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ShowCardId)
                    .HasColumnType("varchar(18)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");
            });

            modelBuilder.Entity<Patientextend>(entity =>
            {
                entity.ToTable("patientextends");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.BirthType)
                    .HasColumnType("varchar(256)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Blindfold).HasColumnType("bit(1)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.Distance0).HasColumnType("bit(1)");

                entity.Property(e => e.Distance1).HasColumnType("bit(1)");

                entity.Property(e => e.Distance2).HasColumnType("bit(1)");

                entity.Property(e => e.Eatting0).HasColumnType("bit(1)");

                entity.Property(e => e.Eatting1).HasColumnType("bit(1)");

                entity.Property(e => e.Eatting2).HasColumnType("bit(1)");

                entity.Property(e => e.Eatting3).HasColumnType("bit(1)");

                entity.Property(e => e.Eatting4).HasColumnType("bit(1)");

                entity.Property(e => e.FatherGlassesL).HasColumnType("int(11)");

                entity.Property(e => e.FatherGlassesR).HasColumnType("int(11)");

                entity.Property(e => e.FirstWear).HasMaxLength(6);

                entity.Property(e => e.Frame).HasColumnType("bit(1)");

                entity.Property(e => e.GlassesStrengthL).HasColumnType("int(11)");

                entity.Property(e => e.GlassesStrengthR).HasColumnType("int(11)");

                entity.Property(e => e.HardLenses).HasColumnType("bit(1)");

                entity.Property(e => e.InterestClasses0).HasColumnType("bit(1)");

                entity.Property(e => e.InterestClasses1).HasColumnType("bit(1)");

                entity.Property(e => e.InterestClasses2).HasColumnType("bit(1)");

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.LieReading0).HasColumnType("bit(1)");

                entity.Property(e => e.LieReading1).HasColumnType("bit(1)");

                entity.Property(e => e.LieReading2).HasColumnType("bit(1)");

                entity.Property(e => e.LieReading3).HasColumnType("bit(1)");

                entity.Property(e => e.LowlightReadingNever).HasColumnType("bit(1)");

                entity.Property(e => e.LowlightReadingOften).HasColumnType("bit(1)");

                entity.Property(e => e.MedicalHistory0).HasColumnType("bit(1)");

                entity.Property(e => e.MedicalHistory1).HasColumnType("bit(1)");

                entity.Property(e => e.MedicalHistory2).HasColumnType("bit(1)");

                entity.Property(e => e.MedicalHistory3).HasColumnType("bit(1)");

                entity.Property(e => e.MedicalHistory4).HasColumnType("bit(1)");

                entity.Property(e => e.MedicalHistory5).HasColumnType("bit(1)");

                entity.Property(e => e.MedicalHistory6).HasColumnType("bit(1)");

                entity.Property(e => e.MedicalHistory7).HasColumnType("bit(1)");

                entity.Property(e => e.MedicalHistory8).HasColumnType("bit(1)");

                entity.Property(e => e.MedicalHistory9).HasColumnType("bit(1)");

                entity.Property(e => e.MedicalTreat0).HasColumnType("bit(1)");

                entity.Property(e => e.MedicalTreat1).HasColumnType("bit(1)");

                entity.Property(e => e.MedicalTreat2).HasColumnType("bit(1)");

                entity.Property(e => e.MedicalTreat3).HasColumnType("bit(1)");

                entity.Property(e => e.MedicalTreat4).HasColumnType("bit(1)");

                entity.Property(e => e.MedicalTreat5).HasColumnType("bit(1)");

                entity.Property(e => e.MedicalTreat6).HasColumnType("bit(1)");

                entity.Property(e => e.MotherGlassesL).HasColumnType("int(11)");

                entity.Property(e => e.MotherGlassesR).HasColumnType("int(11)");

                entity.Property(e => e.Myopia).HasColumnType("bit(1)");

                entity.Property(e => e.MyopiaAge).HasColumnType("int(11)");

                entity.Property(e => e.Often).HasColumnType("bit(1)");

                entity.Property(e => e.Oklenses)
                    .HasColumnType("bit(1)")
                    .HasColumnName("OKLenses");

                entity.Property(e => e.OldStrengthL).HasColumnType("int(11)");

                entity.Property(e => e.OldStrengthR).HasColumnType("int(11)");

                entity.Property(e => e.OutdoorActivity0).HasColumnType("bit(1)");

                entity.Property(e => e.OutdoorActivity1).HasColumnType("bit(1)");

                entity.Property(e => e.OutdoorActivity2).HasColumnType("bit(1)");

                entity.Property(e => e.PatientId).HasColumnType("bigint(20)");

                entity.Property(e => e.ReadingTime0).HasColumnType("bit(1)");

                entity.Property(e => e.ReadingTime1).HasColumnType("bit(1)");

                entity.Property(e => e.ReadingTime2).HasColumnType("bit(1)");

                entity.Property(e => e.ReadingTime3).HasColumnType("bit(1)");

                entity.Property(e => e.ReadingUnupright).HasColumnType("bit(1)");

                entity.Property(e => e.ReadingUpright).HasColumnType("bit(1)");

                entity.Property(e => e.SleepTime0).HasColumnType("bit(1)");

                entity.Property(e => e.SleepTime1).HasColumnType("bit(1)");

                entity.Property(e => e.SleepTime2).HasColumnType("bit(1)");

                entity.Property(e => e.SoftLenses).HasColumnType("bit(1)");

                entity.Property(e => e.UsePhone0).HasColumnType("bit(1)");

                entity.Property(e => e.UsePhone1).HasColumnType("bit(1)");

                entity.Property(e => e.UsePhone2).HasColumnType("bit(1)");
            });

            modelBuilder.Entity<Referral>(entity =>
            {
                entity.ToTable("referrals");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.OrganizationCode)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.OrganizationCodeReferralFrom)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.OrganizationCodeReferralFromDisplayName)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.OrganizationCodeReferralTo)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.OrganizationCodeReferralToDisplayName)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.PatientBirthdate).HasMaxLength(6);

                entity.Property(e => e.PatientGender).HasColumnType("int(11)");

                entity.Property(e => e.PatientId).HasColumnType("bigint(20)");

                entity.Property(e => e.ScreeningId).HasColumnType("bigint(20)");

                entity.Property(e => e.ScreeningUnitCode)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Reporttemplate>(entity =>
            {
                entity.ToTable("reporttemplates");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.TemplateDescription)
                    .IsRequired()
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TemplateHtmlContent)
                    .IsRequired()
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TemplateName)
                    .IsRequired()
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TemplatePreview)
                    .HasColumnType("varchar(1024)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TemplateType).HasColumnType("tinyint(3) unsigned");
            });

            modelBuilder.Entity<Reporttenanttemplate>(entity =>
            {
                entity.ToTable("reporttenanttemplates");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.TemplateId).HasColumnType("bigint(20)");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Screening>(entity =>
            {
                entity.ToTable("screenings");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.OrganizationCode)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.PatientId).HasColumnType("bigint(20)");

                entity.Property(e => e.ScreeningUnitCode)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Screeningunit>(entity =>
            {
                entity.ToTable("screeningunits");

                entity.HasIndex(e => e.ParentId, "IX_ScreeningUnits_ParentId");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.AbsoluteSe)
                    .HasPrecision(5, 2)
                    .HasColumnName("AbsoluteSE");

                entity.Property(e => e.Code)
                    .IsRequired()
                    .HasColumnType("varchar(95)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.DisplayName)
                    .IsRequired()
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.MaxSe)
                    .HasPrecision(5, 2)
                    .HasColumnName("MaxSE");

                entity.Property(e => e.MinDc)
                    .HasPrecision(5, 2)
                    .HasColumnName("MinDC");

                entity.Property(e => e.MinSe)
                    .HasPrecision(5, 2)
                    .HasColumnName("MinSE");

                entity.Property(e => e.MinVisionFive).HasColumnType("tinyint(3) unsigned");

                entity.Property(e => e.MinVisionSix).HasColumnType("tinyint(3) unsigned");

                entity.Property(e => e.OrganizationCode)
                    .HasColumnType("longtext")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ParentId).HasColumnType("bigint(20)");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.HasOne(d => d.Parent)
                    .WithMany(p => p.InverseParent)
                    .HasForeignKey(d => d.ParentId)
                    .HasConstraintName("FK_ScreeningUnits_ScreeningUnits_ParentId");
            });

            modelBuilder.Entity<Screeninstrument>(entity =>
            {
                entity.ToTable("screeninstruments");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.Anisocoria).HasColumnType("tinyint(3) unsigned");

                entity.Property(e => e.Anisometropia).HasColumnType("tinyint(3) unsigned");

                entity.Property(e => e.Bmi).HasPrecision(10, 3);

                entity.Property(e => e.BmiLevel).HasColumnType("int(11)");

                entity.Property(e => e.ClinicDate).HasMaxLength(6);

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.DeviceId)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.DeviceName)
                    .HasColumnType("varchar(12)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ExamRecordId).HasColumnType("bigint(20)");

                entity.Property(e => e.ExamRecordType).HasColumnType("int(11)");

                entity.Property(e => e.Fixation).HasColumnType("tinyint(3) unsigned");

                entity.Property(e => e.Height).HasPrecision(5, 2);

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Lastigmatism)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("LAstigmatism");

                entity.Property(e => e.Laxis1)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("LAxis1");

                entity.Property(e => e.Laxis2)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("LAxis2");

                entity.Property(e => e.Ldc1)
                    .HasPrecision(4, 2)
                    .HasColumnName("LDC1");

                entity.Property(e => e.Ldc2)
                    .HasPrecision(4, 2)
                    .HasColumnName("LDC2");

                entity.Property(e => e.Lds1)
                    .HasPrecision(4, 2)
                    .HasColumnName("LDS1");

                entity.Property(e => e.Lds2)
                    .HasPrecision(4, 2)
                    .HasColumnName("LDS2");

                entity.Property(e => e.LgazeH)
                    .HasColumnType("int(11)")
                    .HasColumnName("LGazeH");

                entity.Property(e => e.LgazeV)
                    .HasColumnType("int(11)")
                    .HasColumnName("LGazeV");

                entity.Property(e => e.Llongsight)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("LLongsight");

                entity.Property(e => e.Lpupil)
                    .HasPrecision(2, 1)
                    .HasColumnName("LPupil");

                entity.Property(e => e.Lse1)
                    .HasPrecision(4, 2)
                    .HasColumnName("LSE1");

                entity.Property(e => e.Lse2)
                    .HasPrecision(4, 2)
                    .HasColumnName("LSE2");

                entity.Property(e => e.Lshortsight)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("LShortsight");

                entity.Property(e => e.Lstrabism)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("LStrabism");

                entity.Property(e => e.OrganizationCode)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.PatientBirthdate).HasMaxLength(6);

                entity.Property(e => e.PatientGender).HasColumnType("int(11)");

                entity.Property(e => e.PatientId).HasColumnType("bigint(20)");

                entity.Property(e => e.PatientMonth).HasColumnType("int(11)");

                entity.Property(e => e.Pd)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("PD");

                entity.Property(e => e.ProductKey)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Rastigmatism)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("RAstigmatism");

                entity.Property(e => e.Raxis1)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("RAxis1");

                entity.Property(e => e.Raxis2)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("RAxis2");

                entity.Property(e => e.Rdc1)
                    .HasPrecision(4, 2)
                    .HasColumnName("RDC1");

                entity.Property(e => e.Rdc2)
                    .HasPrecision(4, 2)
                    .HasColumnName("RDC2");

                entity.Property(e => e.Rds1)
                    .HasPrecision(4, 2)
                    .HasColumnName("RDS1");

                entity.Property(e => e.Rds2)
                    .HasPrecision(4, 2)
                    .HasColumnName("RDS2");

                entity.Property(e => e.Remark)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.RgazeH)
                    .HasColumnType("int(11)")
                    .HasColumnName("RGazeH");

                entity.Property(e => e.RgazeV)
                    .HasColumnType("int(11)")
                    .HasColumnName("RGazeV");

                entity.Property(e => e.Rlongsight)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("RLongsight");

                entity.Property(e => e.Rpupil)
                    .HasPrecision(2, 1)
                    .HasColumnName("RPupil");

                entity.Property(e => e.Rse1)
                    .HasPrecision(4, 2)
                    .HasColumnName("RSE1");

                entity.Property(e => e.Rse2)
                    .HasPrecision(4, 2)
                    .HasColumnName("RSE2");

                entity.Property(e => e.Rshortsight)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("RShortsight");

                entity.Property(e => e.Rstrabism)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("RStrabism");

                entity.Property(e => e.ScreeningId).HasColumnType("bigint(20)");

                entity.Property(e => e.ScreeningUnitCode)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Temperature).HasPrecision(4, 2);

                entity.Property(e => e.TemperatureLevel).HasColumnType("int(11)");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.Weight).HasPrecision(5, 2);
            });

            modelBuilder.Entity<Visualchart>(entity =>
            {
                entity.ToTable("visualcharts");

                entity.Property(e => e.Id).HasColumnType("bigint(20)");

                entity.Property(e => e.AxisOculi).HasColumnType("tinyint(3) unsigned");

                entity.Property(e => e.ClinicDate).HasMaxLength(6);

                entity.Property(e => e.CreationTime).HasMaxLength(6);

                entity.Property(e => e.CreatorUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeleterUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.DeletionTime).HasMaxLength(6);

                entity.Property(e => e.DeviceId)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.DeviceName)
                    .HasColumnType("varchar(12)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.ExamRecordId).HasColumnType("bigint(20)");

                entity.Property(e => e.ExamRecordType).HasColumnType("int(11)");

                entity.Property(e => e.IsDeleted).HasColumnType("bit(1)");

                entity.Property(e => e.LastModificationTime).HasMaxLength(6);

                entity.Property(e => e.LastModifierUserId).HasColumnType("bigint(20)");

                entity.Property(e => e.Levaluation)
                    .HasColumnType("int(11)")
                    .HasColumnName("LEvaluation");

                entity.Property(e => e.LevaluationNear)
                    .HasColumnType("int(11)")
                    .HasColumnName("LEvaluationNear");

                entity.Property(e => e.Lvision)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("LVision");

                entity.Property(e => e.LvisionNear)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("LVisionNear");

                entity.Property(e => e.LvisionRectify)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("LVisionRectify");

                entity.Property(e => e.LvisionRectifyNear)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("LVisionRectifyNear");

                entity.Property(e => e.OrganizationCode)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.PatientBirthdate).HasMaxLength(6);

                entity.Property(e => e.PatientGender).HasColumnType("int(11)");

                entity.Property(e => e.PatientId).HasColumnType("bigint(20)");

                entity.Property(e => e.PatientMonth).HasColumnType("int(11)");

                entity.Property(e => e.ProductKey)
                    .HasColumnType("varchar(32)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Rectify).HasColumnType("tinyint(3) unsigned");

                entity.Property(e => e.Remark)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.Revaluation)
                    .HasColumnType("int(11)")
                    .HasColumnName("REvaluation");

                entity.Property(e => e.RevaluationNear)
                    .HasColumnType("int(11)")
                    .HasColumnName("REvaluationNear");

                entity.Property(e => e.Rvision)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("RVision");

                entity.Property(e => e.RvisionNear)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("RVisionNear");

                entity.Property(e => e.RvisionRectify)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("RVisionRectify");

                entity.Property(e => e.RvisionRectifyNear)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("RVisionRectifyNear");

                entity.Property(e => e.ScreeningId).HasColumnType("bigint(20)");

                entity.Property(e => e.ScreeningUnitCode)
                    .HasColumnType("varchar(128)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.TenantId).HasColumnType("int(11)");

                entity.Property(e => e.Uvision)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("UVision");

                entity.Property(e => e.UvisionRectify)
                    .HasColumnType("tinyint(3) unsigned")
                    .HasColumnName("UVisionRectify");
            });

            OnModelCreatingPartial(modelBuilder);
        }

        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
    }
}
